<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserinfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        // public function up()
        /*
            id int 11 用户信息 ID
            user_id int 11 用户ID
            school_id int 11 学校 ID
            name string 36 姓名
            avatar string 255 头像
            gender tinyint 4 性别
            age int 11 年龄
            birthday timestamp 生日
            school string 255 学校
            profession string 255 专业
            idcard string 36 身份证号
            student_number string 36 学号
            enrollment_year string 36 入学年份
        */

        Schema::create('userinfo', function (Blueprint $table) {
            $table->increments('id')->comment('用户信息id');
            $table->integer('user_id')->comment('用户id');
            $table->integer('school_id')->comment('学校id');
            $table->string('name', 36)->comment('姓名');
            $table->string('avatar', 255)->comment('头像');
            $table->tinyInteger('gender')->comment('性别');
            $table->integer('age')->comment('年龄');
            $table->timestamp('birthday')->comment('生日');
            $table->string('school',255)->comment('学校');
            $table->string('profession',255)->comment('专业');
            $table->string('idcard',36)->comment('身份证号');
            $table->string('student_number',36)->comment('学号');
            $table->string('enrollment_year',36)->comment('入学年份');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::dropIfExists('userinfo');
    }
}
